#ifndef BOOK_LIST_H
#define BOOK_LIST_H

#include "book_info.h"
#include "book.h"
#include "tools.h"

class BookList //书单类
{
public :
	unsigned int m_id; //书单ID
	string m_name;		//书单名
	map<unsigned int,BookInfo> mapBookInfo;

	BookList(void);
	BookList(unsigned int id,const char* name);
	bool addBook(unsigned int book_id);  //输入一个已存在书号,检索目录，将这本书添加到书单
	bool addBook(Book& book);			//添加一本新的书，
	bool delBook(unsigned int book_id);	//输入一个书号，从书单中删除
	vector<BookInfo> findBook(const char* book_name);//输入一个书名查找书号
	unsigned int getId(void);
};
extern BookList  BookIndex;//全局目录
void BookListSave(BookList& booklist);
BookList* BookListLoad(unsigned int list_id);

void IndexSave(void);
void IndexLoad(void);

#endif
